/* Copyright 2001,2002,2003 NAH6 BV
 * All Rights Reserved
 *
 *  $Header: /var/lib/cvs/secphone/ui/database/SysCallLog.h,v 1.3 2003/11/21 12:39:24 itsme Exp $
 *
 *
 */


#ifndef __SYSCALLLOG_H__

#include <windows.h>
#include "CeDatabase.h"

enum SysCallType {
    SYSCALL_MISSED=4,
    SYSCALL_OUTGOING=5,
    SYSCALL_INCOMING=6,
    SYSCALL_REJECTED=7,
};

// numbertype is an abbreviation of the type of number
// w=worktel, m=mobile tel, h=hometel, ...
class SysCallLogEntry {
public:
   char *name;
   char *number;
   char *numberType;
   FILETIME startTime;
   FILETIME endTime;
   SysCallType callType;
};

class SysCallLog {
public:
    SysCallLog();
    ~SysCallLog();

    void Open();

    void AddEntry(const SysCallLogEntry &entry);
    void RemoveEntry(char *number);

private:
        CeDatabase m_db;

    WCHAR *DatabaseName();
};

// database field id's
enum DBSYSCALLLOG_FIELDS {
    //  1 exists, but use is unknown FIELDID(1, CEVT_I2)
    DBSYSCALLLOG_START_FIELD=FIELDID(2, CEVT_FILETIME),
    DBSYSCALLLOG_END_FIELD=FIELDID(3, CEVT_FILETIME),
    DBSYSCALLLOG_CALLTYPE_FIELD=FIELDID(4, CEVT_I4),
    //  5 is not used
    DBSYSCALLLOG_NUMBER_FIELD=FIELDID(6, CEVT_LPWSTR),
    DBSYSCALLLOG_NAME_FIELD=FIELDID(7, CEVT_LPWSTR),
    //  8 is not used
    //  9 exists, but use is unknown FIELDID(9, CEVT_I4)
    DBSYSCALLLOG_NUMBERTYPE_FIELD=FIELDID(10, CEVT_LPWSTR),
};

#define __SYSCALLLOG_H__
#endif
